STM32 DAP Debug Context ¶
Important
This context requires the DebugMCP VS Code extension for debug sessions and for flashing routed through the debugger. Installing STM32CubeProgrammer alone does not satisfy this dependency. To use the STM32CubeProgrammer Context for flashing without DebugMCP, the DAP Debug Context is not needed in the project.
Purpose and scope ¶
The STM32 DAP Debug Context prepares, checks, and launches debug sessions for STM32 projects through the DebugMCP VS Code extension.
Debug workflows ¶
Check the debug environment.
Create or update a debug configuration.
Check the configuration before launch.
Launch a debug session through an ST-LINK GDB server.
Use this context in STM32CubeIDE for Visual Studio Code. VS Code is required. The project must be the top-level folder in the VS Code workspace and must be discovered by STM32CubeIDE for Visual Studio Code (cubified) before debugging. See the STM32CubeIDE for Visual Studio Code documentation.
The context also requires the separately installed
DebugMCP VS Code extension
(
ozzafar.debugmcpextension), as well as the STM32CubeIDE for Visual Studio
Code extension (
stmicroelectronics.stm32-vscode-extension). The
cube-agentic-ai-debug-dap
bundle supports the VS Code target only. The
installer declares both extensions as dependencies. For a VS Code target,
cube
agentic-ai
setup
--install-vscode-extensions
installs them in the
selected profile. For an existing project, run
cube
agentic-ai
doctor
<project>
--fix
--vscode-profile
"<exact
profile
name>"
to install missing declared extensions there. Without the explicit profile
and
--fix, doctor only reports the extension checks and next steps. VS Code
itself is a prerequisite and is never installed by the toolkit.
DebugMCP is a third-party extension and provides the debug tools. To avoid
requiring it for flashing through the STM32CubeProgrammer Context, omit this
debug context. After setup and project generation, run
Developer:
Reload
Window
once for cubification and tool discovery. A reload
is not needed after every debug configuration or MCP update. This context
supports ST-LINK probes only. SEGGER/J-Link and generic GDB servers are not
supported. Configure the ST-LINK probe according to its vendor instructions.
The project also needs a valid STM32 debug configuration and the STM32Cube
CMSIS scanner bundle. ST-LINK uses the
stlink-gdbserver
bundle, which
setup resolves as a declared dependency.
A launch that writes a firmware image overwrites target flash and resets the device. The user must approve this operation before launch.
The context is delivered in the
cube-agentic-ai-debug-dap
bundle.
Troubleshooting ¶
For common VS Code setup and debugger checks, see FAQ and troubleshooting.
Typical prompts ¶
Check the debug environment and configure this project for an ST-LINK GDB server.Check this debug configuration, then launch a session using ST-LINK.